package bishi;

import java.util.ArrayList;
import java.util.Scanner;

/**
 * @Author liuhaoqi
 * @Date 2020/8/31 21:19
 * @Version 1.0
 */
public class T58_02 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String s = scanner.nextLine();
        String s1 = s.substring(0, s.lastIndexOf(','));
        String s2 = s.substring(s.lastIndexOf(',') + 1, s.length() - 1);
        String s3 = s1.replaceAll("\\[", "").replaceAll("\\]", "")
                .replaceAll("\"", "").replaceAll(",", " ");
        String s4 = s2.replaceAll("\"", "");
        System.out.println();
        String[] split1 = s3.split("\\s+");
        String[] split2 = s4.split("\\s+");
        ArrayList<String> list = new ArrayList<>();
        int mark = 0;
        for (int i = 0; i < split2.length; i++) {
            for (int j = 0; j < split1.length; j++) {
                if (split2[i].equals(split1[j])) {
                    mark = i;
                    break;
                }
            }
            for (int j = 0; j < split1.length; j++) {
                split2[mark] = split1[j];

            }
        }
        System.out.println();
    }
}
//[["question","issue"],["difficult","embarrassment"]],"this question is too difficult for me to answer"
